{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>商家列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->           
            <div class="row">
                <div class="col-sm-12">   
                                     
                    <form name="admin_list_sea" class="form-search" method="post" action="{:url('index')}">
                        <div class="col-sm-3">
                            <div class="input-group">
                                <input type="text" id="key" class="form-control" name="key" value="" placeholder="输入需查询的商家账号/昵称/手机号" />   
                                <span class="input-group-btn"> 
                                    <button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button> 
                                </span>
                            </div>
                        </div>
                    </form>                         
                </div>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th width="4%">ID</th>
                                <th width="9%">商家名称</th>
                                <th width="9%">商家类型</th>
                                <th width="5%">logo</th>
                                <th width="5%">联系人</th>
                                <th width="5%">联系电话</th>
                                <th width="5%">公司地址</th>
                                <th width="6%">主要经营</th>
                                <th width="5%">经营年限</th>
                                <th width="6%">状态</th>
                                <th width="10%">注册时间</th>
                                <th width="10%">操作</th>
                            </tr>
                        </thead>                       
                            <tr class="long-td">
                            	 {volist name="list" id='d'}
                                <td>{$d.id}</td>
                                <td>{$d.company}</td>
                                <td>
                                    {if $d.company_type==1 }
                                        合作社
                                    {elseif $d.company_type==2 }
                                        家庭企业
                                    {elseif $d.company_type==3}
                                        农庄
                                    {elseif $d.company_type==4}
            	  龙头企业	
                              {/if}
                                </td>
                               
                                <td>
                                    <img src="/uploads/face/{d.head_img}" class="img-circle" style="width:35px;height:35px" onerror="this.src='/static/admin/images/head_default.gif'"/>                                  
                                </td>
                                <td>{$d.contact}</td>
                                <td>{$d.phone}</td>                                  
                                <td>{$d.address}</td>
                                <td>{$d.main_sell}</td>
                                <td>{$d.year}</td>                                                                
                                <td>                             
                                    {if $d.status==1}
                                        <a class="red" href="javascript:;" onclick="member_status({d.id});">
                                            <div id="zt{d.id}"><span class="label label-info">开业</span></div>
                                        </a>
                                     {elseif $d.status==2}
                                        <a class="red" href="javascript:;" onclick="member_status({d.id});">
                                            <div id="zt{d.id}"><span class="label label-info">停业</span></div>
                                        </a>
                                    {else}
                                        <a class="red" href="javascript:;" onclick="member_status({d.id});">
                                            <div id="zt{d.id}"><span class="label label-danger">删除</span></div>
                                        </a>
                                    {/if}                               
                                </td>
                                <td>{$d.add_time}</td> 
                                <td>                                  
                                    <a href="javascript:;" onclick="edit_member({$d.id})" class="btn btn-primary btn-outline btn-xs">
                                        <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;
                                    <a href="javascript:;" onclick="del_member({$d.id})" class="btn btn-danger btn-outline btn-xs">
                                        <i class="fa fa-trash-o"></i> 删除</a>                                       
                                </td>
                            </tr>
                           
                        {/volist}
                        <tbody id="list-content"></tbody>
                    </table>
                    <div id="AjaxPage" style=" text-align: right;"></div>
                    <div id="allpage" style=" text-align: right;"></div>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

<!-- 加载动画 -->
<div class="spiner-example">
    <div class="sk-spinner sk-spinner-three-bounce">
        <div class="sk-bounce1"></div>
        <div class="sk-bounce2"></div>
        <div class="sk-bounce3"></div>
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">
	//编辑会员
function edit_member(id){
	
    location.href = './edit_member/id/'+id+'.html';
}

//删除会员
function del_member(id){
    lunhui.confirm(id,'{:url("del_member")}');
}

//用户会员
function member_status(id){
    lunhui.status(id,'{:url("member_status")}');
}

</script>
</script>
</body>
</html>